{% extends 'base.html' %}

{% block contents %}
    
<h2>Loans</h2>

<form action="." method="POST">
<table class="movie_list">
    <tr class="yellow">
	<th>&nbsp;</th>
        <th>Title</th>
        <th>Loaner</th>
        <th>Due date</th>
	<th>Returned</th>
        <th>Created</th>
    </tr>
    <tr>

{% for loan in loans %}
	<td><input type="checkbox" name="{{loan.key}}" value="{{loan.key}}"/></td>
	<td class="title_cell">{{loan.movie.title}}</td>
        <td>{{loan.guest.nickname}}</td>
	{% if loan.over_due %}
	<td>{{loan.due_date.date}}</td>
	{% else %}
	<td class="over_due">{{loan.due_date.date}}</td>
	{% endif %}
	<td>{{loan.returned.date}}</td>
	<td>{{loan.created_on.date}}</td>
    </tr>
{% endfor %}
</table>
<P/>
For the selected entries:

    <input type="submit" name="extend" value="Extend loan for"/>&nbsp;<input type="text" size="2" name="due_in_days" value="3"/> days. Or
    <input type="submit" name="returned" value="Has been returned. Set status to available and delete loan."/> Or
    <input type="submit" name="remainder" value="Send remainder for over due entries"/><br/>
    
</form>

{% endblock %}